package com.lz.controller;

import com.lz.domain.Test;
import com.lz.service.TestService;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;
import java.util.List;

@RestController
public class TestController {

    @Resource
    private TestService testService;

    @GetMapping("hello")
    public String hello(){
        return "hello";
    }

    @GetMapping("hello/list")
    public List<Test> list(){
        return testService.list();
    }

}
